home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_5 / issue_06 / benchmarks / c_source / fcall < prev    next >
Encoding:
Text File  |  1991-06-04  |  548 b   |  38 lines

  1. /*
  2.  * Function call overhead benchmark
  3.  */
  4.  
  5. #include "timer.h"
  6. #define TIMES 50000
  7.  
  8. main()
  9. #ifdef EMPTY
  10. {
  11.     register unsigned int i,j;
  12.  
  13.     init_timer();
  14.     start_timer();
  15.     for(i = 0; i < TIMES; i++)
  16.         j = empty(i);
  17.     print_elapsed( "fcall  benchmark", USERMIN);
  18.     exit(0);
  19. }
  20.  
  21. empty(k)
  22. register unsigned int k;
  23. {
  24.     return(k);
  25. }
  26. #endif
  27. #ifdef ASSIGN
  28. {
  29.     register unsigned int i,j;
  30.  
  31.     init_timer();
  32.     start_timer();
  33.     for(i = 0; i < TIMES; i++)
  34.         j = i;
  35.     print_elapsed( "fcall  dummy benchmark", USERMIN);
  36. }
  37. #endif
  38.